<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./jq/jquery-3.6.4/jquery-3.6.4.min.js"></script>
</head>
<body>
    <input type="button" value="设置样式" class="btn">
    <div>mydiv</div>
    <script>

      


        $(".btn").click(function(){
            // $("div").css("color","red");
            // $("div").css("border","1px solid red");
            // // $("div").css("width","400px");
            // // $("div").css("height","400px");
            // $("div").css("font-size","30px");
            // $("div").height(400);
            // $("div").width(400);



            //链式写法
            // $("div").css("color","red").css("border","1px solid red").css("font-size","30px").height(400).width(400);
            

            //传递对象(对象字面量或者JSON数据格式的对象)
            $("div").css({
                "color":"red",
                "border":"1px solid red",
                "width":"500px",
                "height":"500px",
                "font-size":"40px"
            });


        
        });
    </script>
</body>
</html>